/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package elevatronic.controllers;

import elevatronic.models.Building;
import elevatronic.models.Elevator;
import pl.gdan.elsy.qconf.Action;
import pl.gdan.elsy.qconf.Brain;

/**
 *
 * @author Exosta
 */
public class ArtificialElevator {

    private static final int STOP = 0;
    private static final int GOING_DOWN = 1;
    private static final int GOING_UP = 2;
    private Brain brain;
    private PerceptionElevator perception;
    private Elevator elevator;
    private Building building;

    public Brain getBrain() {
        return brain;
    }

    public void setBrain(Brain brain) {
        this.brain = brain;
    }

    public PerceptionElevator getPerception() {
        return perception;
    }

    public void setPerception(PerceptionElevator perception) {
        this.perception = perception;
    }

    public Elevator getElevator() {
        return elevator;
    }

    public void setElevator(Elevator elevator) {
        this.elevator = elevator;
    }

    public Building getBuilding() {
        return building;
    }

    public void setBuilding(Building building) {
        this.building = building;
    }

    public ArtificialElevator(Building building) {
        this.building = building;
        Action actionArray[] = new Action[3];
        actionArray[STOP] = new Stop();
        actionArray[GOING_DOWN] = new GoingDown();
        actionArray[GOING_UP] = new GoingUp();
        perception = new PerceptionElevator(this, this.building);
        brain = new Brain(perception, actionArray);
        brain.setAlpha(0.5);
        brain.setGamma(0.9);
        brain.setLambda(0.2);
        brain.setRandActions(10);
    }
}
